﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using CommunitySystem.Assert;
using CommunitySystem.Ctrls;
using CommunitySystem.PublicOfficialSelectionService;
using CommunitySystem.Views;
using org.in2bits.MyXls;

namespace CommunitySystem
{
    public partial class PublicOfficialRecordWindow : AsyncCtrl, IReturnListenerc
    {
        #region IReturnListenerc 成员
        public void BeginReturn()
        {
            Load();
        }
        #endregion
        public NavMoveSwitch Nav { get; set; }
        private EmpbasicService.EmpBasicServiceClient Client = new EmpbasicService.EmpBasicServiceClient();
        private PublicOfficialSelectionService.PublicOfficialSelectionServiceClient Client1 =
            new PublicOfficialSelectionService.PublicOfficialSelectionServiceClient();
        private ObservableCollection<PublicOfficialSelectionService.PublicOfficialRecordModel> selectedempmodel =
            new ObservableCollection<PublicOfficialSelectionService.PublicOfficialRecordModel>();

        public int ID = 0;
        private string Year = "";
        public PublicOfficialRecordWindow(int id,string year)
        {
            InitializeComponent();
            Year = year;
            ID = id;
            Load();
        }
        public void Load()
        {
            selectedempmodel.Clear();
            Client1.GetPublicOfficialRecordbyIDCompleted += new EventHandler<PublicOfficialSelectionService.GetPublicOfficialRecordbyIDCompletedEventArgs>(Client1_GetPublicOfficialRecordbyIDCompleted);
            Client1.GetPublicOfficialRecordbyIDAsync(ID);
        }

        public ObservableCollection<PublicOfficialSelectionService.PublicOfficialRecordModel> empmodel =
            new ObservableCollection<PublicOfficialSelectionService.PublicOfficialRecordModel>();
        void Client1_GetPublicOfficialRecordbyIDCompleted(object sender, PublicOfficialSelectionService.GetPublicOfficialRecordbyIDCompletedEventArgs e)
        {
            foreach (PublicOfficialSelectionService.PublicOfficialRecordModel i in e.Result)
            {
                if (empmodel.Where(p => p.ID == i.PublicOfficialRecordID).FirstOrDefault() == null)
                {
                    empmodel.Add(i);
                }
            }
            foreach (PublicOfficialSelectionService.PublicOfficialRecordModel i in selectedempmodel)
            {
                if (e.Result.Where(p => p.PublicOfficialRecordID == i.ID).FirstOrDefault() != null && i.IsSelected == true)
                {
                    e.Result.Where(p => p.PublicOfficialRecordID == i.ID).FirstOrDefault().IsSelected = true;
                }
            }
            DGRole.ItemsSource = e.Result;
        }

        private void CheckData_Click(object sender, RoutedEventArgs e)
        {
            //if (DGRole.ItemsSource != null)
            //{
            //    foreach (PublicOfficialSelectionService.PublicOfficialRecordModel i in (ObservableCollection<PublicOfficialSelectionService.PublicOfficialRecordModel>)DGRole.ItemsSource)
            //    {
            //        if (i.IsSelected == true && selectedempmodel.Where(p => p.ID == i.PublicOfficialRecordID).FirstOrDefault() == null)
            //        {
            //            selectedempmodel.Add(i);
            //        }
            //        if (selectedempmodel.Where(p => p.ID == i.PublicOfficialRecordID).FirstOrDefault() != null && i.IsSelected == false)
            //        {
            //            selectedempmodel.Remove(selectedempmodel.Where(p => p.ID == i.PublicOfficialRecordID).FirstOrDefault());
            //        }
            //    }
            //}
            //if (selectedempmodel.Count > 0)
            //{
            //    foreach (PublicOfficialSelectionService.PublicOfficialRecordModel i in selectedempmodel)
            //    {
            //        if (i.GeRenStatus == 1 || i.GeRenStatus == 2)
            //        {
            //            SilverlightMessageBoxLibrary.Message.ErrorMessage("所选职位信息状态为不可审核状态！"); 
            //            return;
            //        }
            //    }
            //    if (MessageBox.Show("确定通过审核吗？", "提示", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
            //    {
            //        string ids = "";

            //        foreach (PublicOfficialSelectionService.PublicOfficialRecordModel i in selectedempmodel)
            //        {
            //            ids += i.PublicOfficialRecordID.ToString() + ",";
            //        }
            //        Client1.CheckPublicOfficialRecordModelCompleted -=
            //            new EventHandler<PublicOfficialSelectionService.CheckPublicOfficialRecordModelCompletedEventArgs>(Client1_CheckPublicOfficialRecordModelCompleted);
            //        Client1.CheckPublicOfficialRecordModelCompleted += 
            //            new EventHandler<PublicOfficialSelectionService.CheckPublicOfficialRecordModelCompletedEventArgs>(Client1_CheckPublicOfficialRecordModelCompleted);
            //        Client1.CheckPublicOfficialRecordModelAsync("(" + ids.Substring(0, ids.Length - 1) + ")");
            //    }

            //}
            //else SilverlightMessageBoxLibrary.Message.ErrorMessage("请选择要通过审核的职位信息！"); 

            //selectedempmodel.Clear();
            //if (DGRole.ItemsSource != null)
            //{
            //    foreach (PublicOfficialSelectionService.PublicOfficialRecordModel i in (ObservableCollection<PublicOfficialSelectionService.PublicOfficialRecordModel>)DGRole.ItemsSource)
            //    {
            //        if (i.IsSelected == true && selectedempmodel.Where(p => p.ID == i.PublicOfficialRecordID).FirstOrDefault() == null)
            //        {
            //            selectedempmodel.Add(i);
            //        }
            //        if (selectedempmodel.Where(p => p.ID == i.PublicOfficialRecordID).FirstOrDefault() != null && i.IsSelected == false)
            //        {
            //            selectedempmodel.Remove(selectedempmodel.Where(p => p.ID == i.PublicOfficialRecordID).FirstOrDefault());
            //        }
            //    }
            //}
            //if (selectedempmodel.Count > 0)
            //{
            //    if (selectedempmodel.Count > 1)
            //    {
            //        SilverlightMessageBoxLibrary.Message.ErrorMessage("只能选择一个人员进行查看！");
            //        return;
            //    }
            //    //PublicOfficialRecordEmpsWindow view = new PublicOfficialRecordEmpsWindow(selectedempmodel[0].EmpID);
            //    //Nav.ShowNextPage(selectedempmodel[0].EmpName + "-报名信息", view, this);
            //    PersonnelInfoWindow view = new PersonnelInfoWindow(selectedempmodel[0].PublicOfficialSelectionID,
            //                                                       selectedempmodel[0].EmpName,
            //                                                       selectedempmodel[0].CardNo,
            //                                                       selectedempmodel[0].GeRenStatus,
            //                                                       selectedempmodel[0].PublicOfficialRecordID);
            //    view.Closed += new EventHandler(RMWindow_Closed);
            //    view.Show();
            //}
            //else SilverlightMessageBoxLibrary.Message.ErrorMessage("请选择要查看的人员！"); 

            var seljw = this.DGRole.SelectedItem as PublicOfficialRecordModel;
            if (seljw != null)
            {
                PersonnelInfoWindow view = new PersonnelInfoWindow(seljw.PublicOfficialSelectionID,
                                                               seljw.EmpName,
                                                               seljw.CardNo,
                                                               seljw.GeRenStatus,
                                                               seljw.PublicOfficialRecordID, seljw.FaBuType, seljw.IsLocked == true ? "1" : "0");
                view.Closed += new EventHandler(RMWindow_Closed);
                view.Show();
            }
            else SilverlightMessageBoxLibrary.Message.ErrorMessage("请选择要查看的人员！");
        }
        void RMWindow_Closed(object sender, EventArgs e)
        {
            Load();
        }

        void Client1_CheckPublicOfficialRecordModelCompleted(object sender, PublicOfficialSelectionService.CheckPublicOfficialRecordModelCompletedEventArgs e)
        {
            SilverlightMessageBoxLibrary.Message.InfoMessage("审核成功！");
            Load();
        }

        private void TuiData_Click(object sender, RoutedEventArgs e)
        {
            if (DGRole.ItemsSource != null)
            {
                foreach (PublicOfficialSelectionService.PublicOfficialRecordModel i in (ObservableCollection<PublicOfficialSelectionService.PublicOfficialRecordModel>)DGRole.ItemsSource)
                {
                    if (i.IsSelected == true && selectedempmodel.Where(p => p.ID == i.PublicOfficialRecordID).FirstOrDefault() == null)
                    {
                        selectedempmodel.Add(i);
                    }
                    if (selectedempmodel.Where(p => p.ID == i.PublicOfficialRecordID).FirstOrDefault() != null && i.IsSelected == false)
                    {
                        selectedempmodel.Remove(selectedempmodel.Where(p => p.ID == i.PublicOfficialRecordID).FirstOrDefault());
                    }
                }
            }
            if (selectedempmodel.Count > 0)
            {
                foreach (PublicOfficialSelectionService.PublicOfficialRecordModel i in selectedempmodel)
                {
                    if (i.GeRenStatus == 1 || i.GeRenStatus == 2)
                    {
                        SilverlightMessageBoxLibrary.Message.ErrorMessage("所选职位信息状态为不可退回状态！");
                        return;
                    }
                }
                TuiHuiMemoWindow tuihui = new TuiHuiMemoWindow();
                tuihui.Closed += new EventHandler(tuihui_Closed);
                tuihui.Show();
            }
            else SilverlightMessageBoxLibrary.Message.ErrorMessage("请选择要退回的职位信息！");
        }

        void tuihui_Closed(object sender, EventArgs e)
        {
            if (MessageBox.Show("确定退回吗？", "提示", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
            {
                string ids = "";

                foreach (PublicOfficialSelectionService.PublicOfficialRecordModel i in selectedempmodel)
                {
                    ids += i.PublicOfficialRecordID.ToString() + ",";
                }
                Client1.TuiPublicOfficialRecordModelCompleted -=
                   new EventHandler<PublicOfficialSelectionService.TuiPublicOfficialRecordModelCompletedEventArgs>(Client1_TuiPublicOfficialRecordModelCompleted);
                Client1.TuiPublicOfficialRecordModelCompleted +=
                    new EventHandler<PublicOfficialSelectionService.TuiPublicOfficialRecordModelCompletedEventArgs>(Client1_TuiPublicOfficialRecordModelCompleted);
                Client1.TuiPublicOfficialRecordModelAsync("(" + ids.Substring(0, ids.Length - 1) + ")",
                                                          ((TuiHuiMemoWindow)sender).checkmemo);
            }
        }

        void Client1_TuiPublicOfficialRecordModelCompleted(object sender, PublicOfficialSelectionService.TuiPublicOfficialRecordModelCompletedEventArgs e)
        {
            SilverlightMessageBoxLibrary.Message.InfoMessage("退回成功！");
            Load();
        }

        private void CheckBox_Click(object sender, RoutedEventArgs e)
        {
            CheckBox cb = sender as CheckBox;
            foreach (PublicOfficialSelectionService.PublicOfficialRecordModel p in DGRole.ItemsSource)
            {
                p.IsSelected = (bool)cb.IsChecked;
                //CheckBox cb1 = DGRole.Columns[0].GetCellContent(p) as CheckBox;
                //cb1.IsChecked = p.IsSelected;
                if (p.IsSelected)
                {
                    if (selectedempmodel.Where(i => i.ID == p.ID).FirstOrDefault() == null)
                    {
                        selectedempmodel.Add(p);
                    }
                }
                else
                {
                    if (selectedempmodel.Where(i => i.ID == p.ID).FirstOrDefault() != null)
                    {
                        selectedempmodel.Remove(selectedempmodel.Where(i => i.ID == p.ID).FirstOrDefault());
                    }
                }
            }

        }

        private void ChaData_Click(object sender, RoutedEventArgs e)
        {
            //selectedempmodel.Clear();
            //if (DGRole.ItemsSource != null)
            //{
            //    foreach (PublicOfficialSelectionService.PublicOfficialRecordModel i in (ObservableCollection<PublicOfficialSelectionService.PublicOfficialRecordModel>)DGRole.ItemsSource)
            //    {
            //        if (i.IsSelected == true && selectedempmodel.Where(p => p.ID == i.PublicOfficialRecordID).FirstOrDefault() == null)
            //        {
            //            selectedempmodel.Add(i);
            //        }
            //        if (selectedempmodel.Where(p => p.ID == i.PublicOfficialRecordID).FirstOrDefault() != null && i.IsSelected == false)
            //        {
            //            selectedempmodel.Remove(selectedempmodel.Where(p => p.ID == i.PublicOfficialRecordID).FirstOrDefault());
            //        }
            //    }
            //}
            //if (selectedempmodel.Count > 0)
            //{
            //    if (selectedempmodel.Count > 1)
            //    {
            //        SilverlightMessageBoxLibrary.Message.ErrorMessage("只能选择一个人员进行查看！");
            //        return;
            //    }
            //    PublicOfficialRecordEmpsWindow view = new PublicOfficialRecordEmpsWindow(selectedempmodel[0].EmpID);
            //    Nav.ShowNextPage(selectedempmodel[0].EmpName + "-报名信息", view, this);
            //}
            //else SilverlightMessageBoxLibrary.Message.ErrorMessage("请选择要查看的人员！");

            var seljw = this.DGRole.SelectedItem as PublicOfficialRecordModel;
            if (seljw != null)
            {
                PublicOfficialRecordEmpsWindow view = new PublicOfficialRecordEmpsWindow(seljw.EmpID,Year);
                Nav.ShowNextPage(seljw.EmpName + "-报名信息", view, this);
            }
            else SilverlightMessageBoxLibrary.Message.ErrorMessage("请选择要查看的人员！");
        }
        private Stream ss = null;
        private void btnOut_Click(object sender, RoutedEventArgs e)
        {
            var downLoad = new SaveFileDialog()
            {
                //Filter = "Excel files(2007~2010) (*.xlsx)|*.xlsx|Excel files(2003) (*.xls)|*.xls", //"Excel files (*.xlsx)|*.xlsx|(*.xls)|*.xls",
                Filter = "Excel files(2003) (*.xls)|*.xls",
            };
            if (downLoad.ShowDialog() == true)
            {
                ss = downLoad.OpenFile();
                PageInit();
            }
        }

        public void PageInit()
        {
            ObservableCollection<PublicOfficialSelectionService.PublicOfficialRecordModel> tempforall =
                (ObservableCollection<PublicOfficialSelectionService.PublicOfficialRecordModel>)DGRole.ItemsSource;
            XlsDocument xls = new XlsDocument();
            XF xf = xls.NewXF();
            xf.HorizontalAlignment = HorizontalAlignments.Centered;
            xf.VerticalAlignment = VerticalAlignments.Centered;
            xf.UseBorder = true;
            xf.TopLineStyle = 1;
            xf.TopLineColor = org.in2bits.MyXls.Colors.Black;
            xf.BottomLineStyle = 1;
            xf.BottomLineColor = org.in2bits.MyXls.Colors.Black;
            xf.LeftLineStyle = 1;
            xf.LeftLineColor = org.in2bits.MyXls.Colors.Black;
            xf.RightLineStyle = 1;
            xf.RightLineColor = org.in2bits.MyXls.Colors.Black;
            xf.Font.FontName = "宋体"; // 字体 
            xf.TextWrapRight = true;

            XF xf1 = xls.NewXF();
            xf1.UseBorder = true;
            xf1.TopLineStyle = 1;
            xf1.TopLineColor = org.in2bits.MyXls.Colors.Black;
            xf1.BottomLineStyle = 1;
            xf1.BottomLineColor = org.in2bits.MyXls.Colors.Black;
            xf1.LeftLineStyle = 1;
            xf1.LeftLineColor = org.in2bits.MyXls.Colors.Black;
            xf1.RightLineStyle = 1;
            xf1.RightLineColor = org.in2bits.MyXls.Colors.Black;
            xf1.HorizontalAlignment = HorizontalAlignments.Centered;
            xf1.VerticalAlignment = VerticalAlignments.Centered;
            xf1.Font.Bold = true;
            xf1.Font.Height = 15 * 20;

            XF xf2 = xls.NewXF();
            xf2.UseBorder = true;
            xf2.TopLineStyle = 1;
            xf2.TopLineColor = org.in2bits.MyXls.Colors.Black;
            xf2.BottomLineStyle = 1;
            xf2.BottomLineColor = org.in2bits.MyXls.Colors.Black;
            xf2.LeftLineStyle = 1;
            xf2.LeftLineColor = org.in2bits.MyXls.Colors.Black;
            xf2.RightLineStyle = 1;
            xf2.RightLineColor = org.in2bits.MyXls.Colors.Black;
            xf2.HorizontalAlignment = HorizontalAlignments.Centered;
            xf2.VerticalAlignment = VerticalAlignments.Centered;
            xf2.Font.Bold = true;
            xf2.Font.FontName = "黑体"; // 字体  
            xf2.Font.Height = 12 * 20;
            xf2.TextWrapRight = true;


            Worksheet sheet1 = xls.Workbook.Worksheets.AddNamed("岗位报名信息汇总表");
            sheet1.Cells.Merge(1, 1, 1, 11);
            sheet1.Cells.Add(1, 1, "徐汇区" + Year + "年科级及科以下公务员" + tempforall[0].FaBuType + "岗位报名信息汇总表", xf1);
            sheet1.Cells.Add(2, 1, "序号", xf2);
            sheet1.Cells.Add(2, 2, "报名单位", xf2);
            sheet1.Cells.Add(2, 3, "报名部门", xf2);
            sheet1.Cells.Add(2, 4, "报名科室", xf2);
            sheet1.Cells.Add(2, 5, "报名职位", xf2);
            sheet1.Cells.Add(2, 6, "姓名", xf2);
            sheet1.Cells.Add(2, 7, "证件号", xf2);
            sheet1.Cells.Add(2, 8, "现工作部门", xf2);
            sheet1.Cells.Add(2, 9, "现职务", xf2);
            sheet1.Cells.Add(2, 10, "是否已审核", xf2);
            sheet1.Cells.Add(2, 11, "审核意见", xf2);
            ColumnInfo colInfoxueli1 = new ColumnInfo(xls, sheet1);
            colInfoxueli1.Width = 40 * 256;
            colInfoxueli1.ColumnIndexStart = 2;
            colInfoxueli1.ColumnIndexEnd = 2;
            sheet1.AddColumnInfo(colInfoxueli1);
            ColumnInfo colInfoxueli3 = new ColumnInfo(xls, sheet1);
            colInfoxueli3.Width = 30 * 256;
            colInfoxueli3.ColumnIndexStart = 3;
            colInfoxueli3.ColumnIndexEnd = 3;
            sheet1.AddColumnInfo(colInfoxueli3);
            ColumnInfo colInfoxueli9 = new ColumnInfo(xls, sheet1);
            colInfoxueli9.Width = 30 * 256;
            colInfoxueli9.ColumnIndexStart = 4;
            colInfoxueli9.ColumnIndexEnd = 4;
            sheet1.AddColumnInfo(colInfoxueli9);
            ColumnInfo colInfoxueli4 = new ColumnInfo(xls, sheet1);
            colInfoxueli4.Width = 30 * 256;
            colInfoxueli4.ColumnIndexStart = 6;
            colInfoxueli4.ColumnIndexEnd = 6;
            sheet1.AddColumnInfo(colInfoxueli4);
            ColumnInfo colInfoxueli8 = new ColumnInfo(xls, sheet1);
            colInfoxueli8.Width = 30 * 256;
            colInfoxueli8.ColumnIndexStart = 7;
            colInfoxueli8.ColumnIndexEnd = 7;
            sheet1.AddColumnInfo(colInfoxueli8);
            ColumnInfo colInfoxueli6 = new ColumnInfo(xls, sheet1);
            colInfoxueli6.Width = 40 * 256;
            colInfoxueli6.ColumnIndexStart = 8;
            colInfoxueli6.ColumnIndexEnd = 8;
            sheet1.AddColumnInfo(colInfoxueli6);
            ColumnInfo colInfoxueli7 = new ColumnInfo(xls, sheet1);
            colInfoxueli7.Width = 30 * 256;
            colInfoxueli7.ColumnIndexStart = 9;
            colInfoxueli7.ColumnIndexEnd = 9;
            sheet1.AddColumnInfo(colInfoxueli7);

            //填充内容    
            if (tempforall.Count != 0)
            {
                for (int i = 0; i < tempforall.Count; i++)
                {
                    sheet1.Cells.Add(i + 3, 1, i+ 1, xf);
                    if (tempforall[i].Unit != null) sheet1.Cells.Add(i + 3, 2, "徐汇区", xf);
                    else sheet1.Cells.Add(i + 3, 2, "", xf);
                    if (tempforall[i].Unit != null) sheet1.Cells.Add(i + 3, 3, tempforall[i].Unit.ToString(), xf);
                    else sheet1.Cells.Add(i + 3, 3, "", xf);
                    if (tempforall[i].Department_Duty != null) sheet1.Cells.Add(i + 3, 4, tempforall[i].Department_Duty.ToString(), xf);
                    else sheet1.Cells.Add(i + 3, 4, "", xf);
                    if (tempforall[i].Duty != null) sheet1.Cells.Add(i + 3, 5, tempforall[i].Duty.ToString(), xf);
                    else sheet1.Cells.Add(i + 3, 5, "", xf);
                    if (tempforall[i].EmpName != null) sheet1.Cells.Add(i + 3, 6, tempforall[i].EmpName.ToString(), xf);
                    else sheet1.Cells.Add(i + 3, 6, "", xf);
                    if (tempforall[i].CardNo != null) sheet1.Cells.Add(i + 3, 7, tempforall[i].CardNo.ToString(), xf);
                    else sheet1.Cells.Add(i + 3, 7, "", xf);
                    if (tempforall[i].NowUnit != null) sheet1.Cells.Add(i + 3, 8, tempforall[i].NowUnit.ToString(), xf);
                    else sheet1.Cells.Add(i + 3, 8, "", xf);
                    if (tempforall[i].NowDuty != null) sheet1.Cells.Add(i + 3, 9, tempforall[i].NowDuty.ToString(), xf);
                    else sheet1.Cells.Add(i + 3, 9, "", xf);
                    if (tempforall[i].CheckState != null) sheet1.Cells.Add(i + 3,10, tempforall[i].CheckState.ToString(), xf);
                    else sheet1.Cells.Add(i + 3, 10, "", xf);
                    if (tempforall[i].CheckMemo != null) sheet1.Cells.Add(i + 3, 11, tempforall[i].CheckMemo.ToString(), xf);
                    else sheet1.Cells.Add(i + 3, 11, "", xf);
                }

                sheet1.Cells.Merge(3, tempforall.Count + 2, 2, 2);

                int sint1 = 3;
                int eint1 = 0;
                for (int i = 0; i < tempforall.Count - 1; i++)
                {
                    if (tempforall[i].Unit == tempforall[i + 1].Unit)
                    {
                        eint1 = i + 1 + 3;
                        if (i == tempforall.Count - 2)
                        {
                            sheet1.Cells.Merge(sint1, eint1, 3, 3);
                        }
                    }
                    else
                    {
                        sheet1.Cells.Merge(sint1, eint1, 3, 3);
                        sint1 = eint1 + 1;
                        eint1 += 1;
                    }
                }
            }

            xls.Save(ss);
            ss.Close();
            ss.Dispose();
            SilverlightMessageBoxLibrary.Message.InfoMessage("导出成功！");
        }

        //#region 翻页
        //private void dataPager1_PageIndexChanged(object sender, EventArgs e)
        //{
        //    int index = dataPager1.PageIndex;

        //    if (DGRole.ItemsSource != null)
        //    {
        //        foreach (PublicOfficialSelectionService.PublicOfficialRecordModel i in (ObservableCollection<PublicOfficialSelectionService.PublicOfficialRecordModel>)DGRole.ItemsSource)
        //        {
        //            if (i.IsSelected == true && selectedempmodel.Where(p => p.ID == i.ID).FirstOrDefault() == null)
        //            {
        //                selectedempmodel.Add(i);
        //            }
        //            if (selectedempmodel.Where(p => p.ID == i.ID).FirstOrDefault() != null && i.IsSelected == false)
        //            {
        //                selectedempmodel.Remove(selectedempmodel.Where(p => p.ID == i.ID).FirstOrDefault());
        //            }
        //        }
        //    }
        //    Client1.GetPublicOfficialRecordbyIDCompleted +=
        //        new EventHandler<PublicOfficialSelectionService.GetPublicOfficialRecordbyIDCompletedEventArgs>(Client1_GetPublicOfficialRecordbyIDCompleted);
        //    Client1.GetPublicOfficialRecordbyIDAsync(ID, index * 20, index * 20 + 20);
        //}
        //#endregion
    }
}
